package com.qq.server.view;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;

import com.qq.server.model.MyQqServer;

public class MyServerFrame extends JFrame implements ActionListener{
    JPanel jp;
    JButton jb1,jb2;
	public static void main(String[] args) {
		MyServerFrame msf=new MyServerFrame();
	}
	MyServerFrame(){
		jp=new JPanel();
		jb1=new JButton("启动服务器");
		jb1.addActionListener(this);
		jb2=new JButton("强制关闭服务器");
		jp.add(jb1);
		jp.add(jb2);
		
		this.add(jp);
		this.setSize(500,400);
		this.setIconImage((new ImageIcon("image/qq.gif")).getImage());
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		this.setVisible(true);	
	}
	@Override
	public void actionPerformed(ActionEvent e) {
		//MyServerFrame就是一个界面，主要是来启动MyQqServer的。
		if(e.getSource()==jb1){
			new MyQqServer();
		}
	}
}
